package templateMethod;

/**
 * 当你的子类必须提供模板中某个方法或步骤时，
 * 就使用抽象方法。如果算法的某个步骤是可选的，
 * 就用钩子。子类可以选择实现这个钩子，但不强制这么做
 */
public class BeverageTestDrive {
    public static void main(String[] args) {
        TeaWithHook teaWithHook = new TeaWithHook();
        CoffeeWithHook coffee = new CoffeeWithHook();

        System.out.println("\nMaking tea .... ");
        teaWithHook.prepareRecipe();

        System.out.println("\nMaking coffee .... ");
        coffee.prepareRecipe();
    }
}
